import ExecuteHelper from '../utils/ExecuteHelper';
import developmentConfig from './ppc-dev';

const getWindowsHostIp = () => {
  const execCommand = 'cat /etc/resolv.conf | grep nameserver | awk \'{ print $2 }\'';
  return ExecuteHelper.runAndGetStdio(execCommand);
};

const standaloneConfig = {
  businessServices: `http://${getWindowsHostIp()}:18899`,
  platformSso: `http://${getWindowsHostIp()}:18888`,
};
// eslint-disable-next-line no-console
console.log('Standalone config of WLS2 ->', standaloneConfig);

export default {
  ...developmentConfig,
  standalone: standaloneConfig,
};
